<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>ZY Player</title>
  <style>
    *{
      margin: 0;
      padding: 0;
    }
    html,body{
      width: 100%;
      height: 100%;
      overflow: hidden;
    }
    #mse{
      width: 100%;
      height: 100%;
    }
  </style>
</head>
<body>
  <div id="mse"></div>
  <script src="//cdn.jsdelivr.net/npm/xgplayer/browser/index.js" type="text/javascript"></script>
  <script src="//cdn.jsdelivr.net/npm/xgplayer-hls.js/browser/index.js" charset="utf-8"></script>
  <script>
    function get (name) {
      var reg = new RegExp("(^|&)"+ name +"=([^&]*)(&|$)");
      var r = window.location.search.substr(1).match(reg);//search,查询？后面的参数，并匹配正则
      if (r!=null)return unescape(r[2]); return null;
    }
    let link = window.location.href
    let info = get('info')
    let time = get('time')
    let flag = info.indexOf('$')
    let url
    if (flag > 0) {
      url = info.split('$')[1]
    } else {
      url = info
    }
    let player = new window.HlsJsPlayer({
      id: 'mse',
      url: url,
      fluid: true,
      autoplay: true,
      playsinline: true,
      height: window.innerHeight,
      width: window.innerWidth,
      'x5-video-player-fullscreen': true,
      'x5-video-orientation': 'landscape'
    })
    player.on('play', function () {
      player.currentTime = time
    })
  </script>
</body>
</html>